﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace QuanLyKho
{
    public partial class frmQuanLyKho : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        private readonly TaiKhoan taiKhoan = new TaiKhoan("Admin", "admin","admin");
        public frmQuanLyKho()
        {
            InitializeComponent();
        }

        private void barChkTienTe_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (barChkTienTe.Checked)
            {
                uctTienTe uctTienTe1 = new uctTienTe(taiKhoan) { Dock = DockStyle.Fill };
                dpnTienTe.Controls.Add(uctTienTe1);
                dpnTienTe.Show();
            }
            else
                dpnTienTe.Close();
        }

        private void dpnTienTe_ClosedPanel(object sender, DevExpress.XtraBars.Docking.DockPanelEventArgs e)
        {
            barChkTienTe.Checked = false;
        }

        private void barChkNhapKhau_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (barChkNhapKhau.Checked)
            {
                uctDanhSachNhapKhau uctDanhSachNhapKhau1 = new uctDanhSachNhapKhau(taiKhoan) { Dock = DockStyle.Fill };
                dpnNhapKhau.Controls.Add(uctDanhSachNhapKhau1);
                dpnNhapKhau.Show();
            }
            else
            {
                dpnNhapKhau.Close();
            }
        }

        private void dpnNhapKhau_ClosedPanel(object sender, DevExpress.XtraBars.Docking.DockPanelEventArgs e)
        {
            barChkNhapKhau.Checked = false;
        }

        public static void themTabPages(UserControl uct)
        {
            // 
            // xtraTabPage1
            // 
            DevExpress.XtraTab.XtraTabPage xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
            tabHienThi.TabPages.Add(xtraTabPage1);
            tabHienThi.SelectedTabPage = xtraTabPage1;
            xtraTabPage1.Name = "xtraTabPage1";
            xtraTabPage1.Size = new System.Drawing.Size(555, 303);
            xtraTabPage1.Text = uct.Name;
            // 
            // uctNhapHang1
            // 
            uct.Dock = DockStyle.Fill;
            xtraTabPage1.Controls.Add(uct);
        }
    }
}
